﻿namespace CommonData.Model.Core
{
    using System;
    using System.Collections.Generic;

    public class ConditionComponent
    {
        private static ConditionComponent component;
        private IDictionary<string, SearchComponent> dicComponent = null;

        private ConditionComponent()
        {
        }

        public ConditionComponent AddComponent(string propertyName, SearchComponent component)
        {
            ConditionComponent.component.DicComponent.Add(propertyName, component);
            return ConditionComponent.component;
        }

        public static ConditionComponent Instance()
        {
            if (component == null)
            {
                component = new ConditionComponent();
                component.DicComponent = new Dictionary<string, SearchComponent>();
            }
            return component;
        }

        public IDictionary<string, SearchComponent> DicComponent
        {
            get
            {
                return this.dicComponent;
            }
            set
            {
                this.dicComponent = value;
            }
        }
    }
}

